
            SPSite site = (SPSite)properties.Feature.Parent;

            SPWebConfigModification controlsSection = new SPWebConfigModification("controls", "configuration/system.web/pages");
            controlsSection.Owner = "@SolutionName";
            controlsSection.Sequence = 20;
            controlsSection.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureSection;
            controlsSection.Value = "<controls></controls>";

            SPWebConfigModification addElement = new SPWebConfigModification(
                @"add[@tagPrefix=""SharePoint""][@namespace=""@SolutionName""][@assembly=""@AssemblyStrongName""]", 
                "configuration/system.web/pages/controls");
            addElement.Owner = "@SolutionName";
            addElement.Sequence = 40;
            addElement.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;
            addElement.Value = @"<add tagPrefix=""SharePoint"" namespace=""@SolutionName"" assembly=""@AssemblyStrongName"" />";

            site.WebApplication.WebConfigModifications.Add(controlsSection);
            site.WebApplication.WebConfigModifications.Add(addElement);
            site.WebApplication.Update();
            site.WebApplication.WebService.ApplyWebConfigModifications();
